<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <title>Thymeleaf switch case Demo</title>
    <link th:href="@{/css/bootstrap5.3.2.min.css}" rel="stylesheet">
</head>
<body>
<div class="container">
    <div class="row">
        <h1>Thymeleaf switch case demo</h1>
        <h4 th:utext="${user.userName}"></h4>
        <div th:switch="${user.role}">
            <p th:case="'ADMIN'">User is an administrator</p>
            <p th:case="'MANAGER'">User is a manager</p>
            <p th:case="'GUEST'">User is a guest</p>
            <p th:case="*">User is some other thing</p>
        </div>
    </div>
</div>
</body>
</html>